<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Siswa extends CI_Controller
{
	var $engineReturn 	= array();
	var $specialValue 	= array();
	var $data			= array();
	
	var $loginIdUser		= "";
	var $loginAksesUser		= "";
	var $menuUserOtority	= "siswa";
	
	public function __construct()
	{
		parent::__construct();
	}
	
	
	public function index()
	{
		$this->data["baseUrl"]			= $this->config->item('base_url');
		$this->data["baseUrlSave"]		= $this->config->item('base_url')."?";
		$this->data["engineTemplate"]	= $this->config->item('base_url')."application/views/engine/template/";
		$this->data["engineModule"]		= $this->config->item('base_url')."application/views/engine/module/";
		$this->data["otority"]			= $this->menuUserOtority;
		$this->data["engineReturn"]		= $this->engineReturn;
		$engineSetting	= array();	
		$system			= $this->uri->segment(2);
		$module			= $this->uri->segment(3);
		$rule			= $this->uri->segment(4);
		$this->load->library('session');
		$this->load->model(array("engine/master", "manual/mod_materi"));
		$this->loginIdUser	= $this->session->userdata('userId');
		$this->loginAksesUser	= $this->session->userdata('akses');
		$this->master->printArr($this->session->userdata, false);
		if($system=='logout')
		{
			$this->session->sess_destroy();
		}
		if($this->loginAksesUser!=$this->menuUserOtority || ($system=='logout'))
		{
			if($system=='ajax')
			{
				$this->output->enable_profiler(false);
				$loginProcess = $this->loginUser();
				if($loginProcess['login'])
				{
					$this->session->sess_destroy();
					$this->session->set_userdata(
										array(
											'userId' 	=> $loginProcess['id']
											, 'akses'	=> $this->menuUserOtority
										)
									);
				}
				$this->load->view("engine/module/login", array(
															'otority' 	=> $this->data["otority"]
															,'engineReturn' 	=> $this->data["engineReturn"]
															, 'baseUrlSave'	=> $this->data["baseUrlSave"]
															, 'login'		=> $loginProcess['login']
															));
			}
			else
			{
				$this->data["engineReturn"]["title"]		= "Login Mahasiswa";
				$this->output->enable_profiler(false);
				$this->load->view("engine/template/header", $this->data);
				$this->load->view("engine/template/login", $this->data);
				$this->load->view("engine/template/footer");
			}
		}
		else
		{
			$this->master->set_ID_USER($this->loginIdUser);
			$this->master->set_USER_OTORITY($this->menuUserOtority);
			switch($system)
			{
				case "manual":
					$this->load->model("engine/mod_sys");
					$this->load->model("manual/mod_hasil");
					switch($module)
					{
						case "download_materi_sub_siswa":
							// siswa/manual/download_materi_sub_siswa/kode_dosen/[all,kode_jurusan]/[all,kode_mata_pelaran]/start
							$d_kode_dosen	= $this->uri->segment(4);
							$d_kode_jurusan	= $this->uri->segment(5);
							$d_kode_mapel	= $this->uri->segment(6);
							$d_start		= $this->uri->segment(7);
							$this->data['engineReturn']['title'] = "Download Materi";
							$this->data['materi'] = "";
							if($d_kode_dosen=="")
							{
								$this->data['mode']	= "dosen";
								$this->data['dosen'] = $this->mod_materi->get_Guru();
							}
							else
							{
								$this->data['mode']		= "materi";
								if($d_kode_jurusan=='all') $d_kode_jurusan == "";
								if($d_kode_mapel=='all') $d_kode_mapel == "";
								$this->data['materi']	= $this->mod_materi->get_materi($d_kode_dosen, $d_kode_jurusan, $d_kode_mapel,$d_start);
							}
							$view_name	= "materi_siswa";
						break;
						case "cek_nilai_sub_siswa":
// siswa/manual/cek_nilai_sub_siswa/tahun/semester
							$n_kelas		= $this->uri->segment(4);
							$n_tahun		= $this->uri->segment(5);
							$n_semester		= $this->uri->segment(6);
							$n_katnilai		= $this->uri->segment(7);
							$this->data['mode']	= "";
							if($n_kelas=="" || $n_tahun=="" || $n_semester=="")
							{
								// Disini nampilin list tahun ama kelas
								$this->data['kelas']	= $this->mod_sys->get_kelas_nilai_siswa($this->loginIdUser);
								$this->data['tahun']	= $this->mod_sys->get_tahun_ajaran_nilai_siswa($this->loginIdUser);
								$this->data['semester']	= $this->mod_sys->get_semester_nilai_siswa($this->loginIdUser);
								
								$this->data['cek_transfer']	= $this->mod_sys->cek_siswa_transfer($this->loginIdUser);
								$this->data['tahun_transfer']	= $this->mod_sys->get_tahun_ajaran_nilai_siswa_transfer($this->loginIdUser);
								$this->data['semester_transfer']	= $this->mod_sys->get_semester_nilai_siswa_transfer($this->loginIdUser);
								
								$this->data['mode']		= "kelas_tahun_semester";
								// terus enter
							}
							elseif($n_kelas!="" & $n_tahun!="" & $n_semester!="")
							{
/*
								// Ama Link buat clear seleksi
								// Disini nampilin Mata Pelajaran si Dosen	
								$this->data['tahun']	= $this->mod_sys->get_tahun_ajaran_from_id($n_tahun);
								$this->data['mapel']	= 
												$this->mod_sys->get_mapel_siswa(
																	$this->loginIdUser, 
																	$n_tahun);
								$this->data['mode']		= "mapel";
							}
							elseif($n_kodemapel!="")
							{ 
							*/
								if($n_kelas=="transfer"){
									$this->data['siswa']		= $this->loginIdUser;
									$this->data['tahun']		= $this->mod_sys->get_tahun_ajaran_from_id($n_tahun);
									$this->data['semester']		= $this->mod_sys->get_semester_from_id($n_semester);
									$this->data['mode']			= "nilai_transfer";
	
									$this->data['list_siswa']	= $this->mod_sys->get_list_siswa_nilai_siswa_transfer($this->loginIdUser,$n_tahun,$n_semester);
									
								}else{
									$this->data['siswa']		= $this->loginIdUser;
									$this->data['kelas']		= $this->mod_sys->get_kelas_from_id($n_kelas);
									$this->data['tahun']		= $this->mod_sys->get_tahun_ajaran_from_id($n_tahun);
									$this->data['semester']		= $this->mod_sys->get_semester_from_id($n_semester);
									$this->data['mengulang']	= $this->mod_hasil->siswa_mengulang($this->loginIdUser,$n_kelas,$n_tahun,$n_semester);
									$this->data['mode']			= "nilai";
	
									$this->data['list_siswa']	= $this->mod_sys->get_list_siswa_nilai_siswa(
																$this->loginIdUser,
																$n_kelas,$n_tahun,$n_semester
																);
									
								}
							}

							$this->data['engineReturn']['title'] = "Nilai Mahasiswa";
							$view_name	= "nilai_siswa";
						break;
						default:
							$this->data['engineReturn']['title'] = "Welcome";
						break;
					}
					if($rule=="ajax")
					{
						$this->output->enable_profiler(false);
						$this->load->view("engine/manual/$view_name", $this->data);
					}
					else
					{
						$this->output->enable_profiler(false);
						$this->load->view("engine/template/header", $this->data);
						$menu		= $this->master->getMenu($this->menuUserOtority, $this->loginIdUser);
						$this->load->view("engine/template/left", array('menu'=>$menu, 'base_url'=>$this->data["baseUrlSave"]));
						$this->load->view("engine/template/right_first",array("title"=>$this->data['engineReturn']['title']));
						$this->load->view("engine/manual/$view_name", $this->data);
						$this->load->view("engine/template/right_last");
						$this->load->view("engine/template/footer");
					}
				break;
				case "engine":
				default:
					$this->data['engineReturn']['title'] = "";
					switch($module)
					{
						case "download_materi_sub_siswa":
							$this->engineReturn = $this->$module("Download Materi", "download_materi_sub_siswa");
						break;
						case "jadwal_mapel_sub_siswa":
							$this->engineReturn = $this->$module("Jadwal Mata Pelajaran", "jadwal_mapel_sub_siswa");
						break;
						case "cek_nilai_sub_siswa":
							$this->engineReturn = $this->$module("Cek Nilai", "cek_nilai_sub_siswa");
						break;
						case "edit_profil_sub_siswa":
							$this->engineReturn = $this->$module("Edit Profil Mahasiswa", "edit_profil_sub_siswa");
						break;
						default:
							$this->data['engineReturn']['title'] = "Welcome";
						break;
					}
					$this->data["engineReturn"]	= $this->engineReturn;
					if(!isset($this->data['engineReturn']['title']))
						$this->data['engineReturn']['title'] = 'Welcome';
					if($rule=="ajax")
					{
						$this->output->enable_profiler(false);
						$this->load->view("engine/module/main", $this->data);
					}
					else
					{
						$this->output->enable_profiler(false);
						$this->load->view("engine/template/header", $this->data);
						$menu		= $this->master->getMenu($this->menuUserOtority, $this->loginIdUser);
						$this->load->view("engine/template/left", array('menu'=>$menu, 'base_url'=>$this->data["baseUrlSave"]));
						$this->load->view("engine/template/right_first",array("title"=>$this->data['engineReturn']['title']));
						$this->load->view("engine/module/main", $this->data);
						$this->load->view("engine/template/right_last");
						$this->load->view("engine/template/footer");
					}
				break;
			}
		}
	}
	
	public function loginUser()
	{
		$user	= $this->uri->segment(3);
		$pass	= $this->uri->segment(4);
		$sql	= "SELECT nim, pass FROM tbl_siswa
					WHERE
					nim	= '$user'";
		$rec	= $this->db->query($sql);
		$count	= $rec->num_rows();
		$res	= $rec->result_array();
		if($count>0)
			if($this->pass_word->decryptPass($res[0]['pass'])==$pass)
				return array('login'=>true,'id'=>$res[0]['nim']);
		else
			return array('login'=>false);
	}
	public function sample($pageTitle, $pageUrl)
	{
		$arraySetting 	= array(
		$pageTitle									// page title
		, $pageUrl									// page url
		, true										// Insert new record
		, true										// Edit Record
		, true										// Delete Record
		, true										// Edit Record if not null
		, $this->master->PAGINATION_ADV_NEXT_PREV_NUMBER	// Pagination Type
		,  "sample_table_all_of"					// Table Name
		, false										// Input Mode cross record
		, ""										// id_user
		, ""										// akses
		, "application/views/upload/"				// upload folder
		, $this->config->item('base_url')			// base url
		, $this->data["engineTemplate"]				// adminPath
		, 'sample'									// modulename
		);
		$arrayField 	= array(
							array(
									"id_coba"					// Field_name
									, "ID"						// Text
									, $this->master->FIELD_VALUE_AUTO	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_HIDDEN
											)
									, true						// Primary key
									, false						// view
									, false						// edit
									, null						// source
									, $this->master->VALIDATION_NONE	// validation
									, false						// filter
									, null						// filter source
								)
							, array(
									"kode_coba"					// Field_name
									, "Kode"					// Text
									, $this->master->FIELD_VALUE_USER	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 100
													, "SIZE"		=> $this->master->ATTR_SIZE_SHORT
													)
											)
									, true						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, true						// filter
									, $this->master->INPUT_TYPE_MEDIUM_TABLE	// filter source
								)
							, array(
									"nama"						// Field_name
									, "Nama"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, true						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, true						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										, null
										)						// filter source
								)
							, array(
									"pass"						// Field_name
									, "Password"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_PASSWORD
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NONE
											)					// validation
									, true						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										, null
										)						// filter source
								)
							, array(
									"text_area"						// Field_name
									, "Text Area"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT_AREA
											, array(
													"ROWS" 			=> 5
													, "COLS"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, array(
										)						// filter source
								)
							, array(
									"text_area_plus"						// Field_name
									, "Text Area Plus"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT_AREA_PLUS_EDITOR
											, array(
													"ROWS" 			=> 5
													, "COLS"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, array(
										)						// filter source
								)
							, array(
									"jenis_kelamin"				// Field_name
									, "Jenis Kelamin"			// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_RADIO
											)
									, false						// Primary key
									, false				// view
									, true						// edit
									, array(array("l", "Laki-laki")
											, array("p", "Perempuan")
											)
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_RADIO
											, null)						// filter source 
								)
							, array(
									"hoby"						// Field_name
									, "Hoby"					// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_CHECKBOX
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array(array("Olahraga")
											, array("Makan Permen")
											, array("Belajar")
											, array("Main ini itu")
											, array("Gak punya hoby")
											, array("ML (Makan Lontong)")
											)
									, array($this->master->VALIDATION_NONE
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_SELECT)						// filter source 
								)
							, array(
									"warna_kulit"				// Field_name
									, "Warna Kulit"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_SELECT
											, array("SIZE" => $this->master->ATTR_SIZE_MEDIUM)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array(array("Hitam")
											, array("PUTIH")
											, array("PUCAT")
											, array("KASAR")
											)
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_SELECT)		// filter source 
								)
							, array(
									"agama"						// Field_name
									, "Agama"					// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_SIMPLE_TABLE
											, array()
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array("data_opsi"						// field
											, "id_opsi"						// id 
											, "sample_table_opsi_data"		// table source						
											, array(
													array(
														"data_opsi",					// field name
														$this->master->OPERATOR_LIKE,	// operand
														"a",								// value
														),
													)
											)
									, array($this->master->VALIDATION_MATCH_TABLE
											, array("sample_table_opsi_data", "id_opsi")
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_SIMPLE_TABLE)		// filter source 
								)
							, array(
									"kebangsaan"				// Field_name
									, "Kebangsaan"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_MEDIUM_TABLE
											, array()
											)
									, false						// Primary key
									, true						// view
									, true						// edit
									, array(
											array(array("nama_data","nd", true, "Nama Data")
													, array("select_one", "so", false, "Select One", 
													array(array("m", "Male"),array("f", "Female")))
												)						// field
											, "id_opsi"						// id 
											, array("sample_table_select_data", "stsd")	// table_name						
											, array(
												array(
													array("sample_table_opsi_data","stod")	// table join
													, array("sample_table_select_data","stsd")				// table source
													, "id_opsi"									// field join
													, "id_opsi"									// field source
													, array(array("data_opsi","",true, "Data Opsi"))					// field join
													)
												)
											, array(
													array(
														array("sample_table_opsi_data", "stod"),					// table name
														"data_opsi",					// field name
														$this->master->OPERATOR_LIKE,	// operand
														"a",								// value
													),
												)
											)
									, array($this->master->VALIDATION_MATCH_TABLE
											, array("sample_table_select_data", "id_opsi")
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_MEDIUM_TABLE
											, null
									)						// filter source 
								)
							, array(
									"keituan"				// Field_name
									, "Keituan"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_ADVANCE_TABLE
											, array()
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array(
											array(array("nama_data", "nd", true, "Nama Data")
													, array("select_one", "so", true, "Select One", array(array("m", "Male"),array("f", "Female")))
												)							// field
											, "id_opsi"						// id 
											, array("sample_table_select_data", "stsd")	// table_name						
											, array(
												array(
													array("sample_table_opsi_data","stod")	// table join
													, array("sample_table_select_data","stsd")				// table source
													, "id_opsi"									// field join
													, "id_opsi"									// field source
													, array(array("data_opsi","",true, "Data Opsi"))					// field join
													)
												)
											, array(										// filter field
													array("Select Data"					
														, array("sample_table_select_data", "stsd")// table destination
														, "nama_data"						// field destination
														, $this->master->INPUT_TYPE_TEXT			// type input search
														, array()							// source
														)
													, array("Search Radio"					
														, array("sample_table_select_data", "stsd")// table destination
														, "select_one"							// field destination
														, $this->master->INPUT_TYPE_RADIO			// type input search
														, array(array("m", "Male")
																,array("f", "Female"))		// source
														)
													, array("Search Select"					
														, array("sample_table_select_data", "stsd")// table destination
														, "select_one"							// field destination
														, $this->master->INPUT_TYPE_SELECT			// type input search
														, array(array("m", "Male")
																,array("f", "Female"))		// source
														)
													, array("Search Select"
														, array("sample_table_opsi_data", "stod")
														, "id_opsi"
														, $this->master->INPUT_TYPE_SIMPLE_TABLE
														, array("data_opsi"						// field
																, "id_opsi"						// id 
																, "sample_table_opsi_data"		// table source						
																)
														)
												)
											)
									, array($this->master->VALIDATION_MATCH_TABLE
											, array("sample_table_select_data","id_opsi")
											)					// validation
									, false						// filter
									, null						// filter source 
								)
							, array(
									"keyword"					// Field_name
									, "Keyword"				// Text
									, $this->master->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_MULTIPLE_VALUE_OUT_TABLE											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array(
										"sample_table_multiple_input_base"			// table name
										, array("nama_data", "Keyword")				// field name
										, "id_multiple_input_base"					// field key
										, "sample_table_multiple_input"				// out source table name
										, "id_multiple_input"						// out source field key
										, "multiple_input_data"						// out source field data
										, "id_coba"									// out source field foreign
											)
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, null						// filter source 
								)
							, array(
									"pengarang"					// Field_name
									, "Pengarang"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_MULTIPLE_VALUE_OUT_TABLE_FOREIGN	)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array(
										"sample_table_multiple_input_base"			// table name
										, array("nama_data", "Keyword")				// field name
										, "id_multiple_input_base"					// field key
										, "sample_table_multiple_input_foreign"		// out source table name
										, "id_multiple_input"						// out source field key
										, "id_multiple_base"						// out source field data
										, "id_coba"									// out source field foreign
											)
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, null						// filter source 
								)
							, array(
									"image"					// Field_name
									, "Image"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_MULTIPLE_VALUE_IMAGE											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array(
										"sample_table_multiple_image"			// out source table name
										, "id_multiple_image"					// out source field key
										, "id_coba"								// out source field foreign
										, "image"								// out source field name
										, "sample"								// directory name for image
											)
									, array($this->master->VALIDATION_FILE_TYPE
											, array("jpg", "png", "bmp", "gif", "swf")
											, array(
												array(
														"initial" 	=>	"resizeWidth"
														, "width" 	=>	200
														, "height"	=>  0
														, "type"	=> "resize"
													),
												array(
														"initial" 	=>	"resizeHeight"
														, "width" 	=>	0
														, "height"	=>  200
														, "type"	=> "resize"
													),
												array(
														"initial" 		=>	"crop"
														, "width" 		=>	200
														, "height"		=>  0
														, "type"		=> "crop"
													),
												array(
														"initial" 	=>	"admin"
														, "width" 	=>	100
														, "height"	=>  0
														, "type"	=> "crop"
														, "thumb_admin"	=> true
													),
												)				// resize
											)					// validation
									, false						// filter
									, null						// filter source 
								)
							, array(
									"image_single"				// Field_name
									, "Image Single"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_IMAGE
											, array("SIZE" => $this->master->ATTR_SIZE_MEDIUM)
											)
									, false						// Primary key
									, true						// view
									, true						// edit
									, array("sample_single")
									, array($this->master->VALIDATION_FILE_TYPE
											, array("jpg", "jpeg", "png", "bmp")
											, array(
												array(
														"initial" 	=> "resizeWidth"
														, "width" 	=> 200
														, "height"	=> 0
														, "type"	=> "resize"
													),
												array(
														"initial" 	=> "resizeHeight"
														, "width" 	=> 0
														, "height"	=> 200
														, "type"	=> "resize"
													),
												array(
														"initial" 	=>	"crop"
														, "width" 	=>	200
														, "height"	=>  0
														, "type"	=> "crop"
													),
												array(
														"initial" 	=>	"admin"
														, "width" 	=>	100
														, "height"	=>  0
														, "type"	=> "crop"
														, "thumb_admin"	=> true
													),
												)				// resize
											)					// validation
									, false						// filter
									, null						// filter source 
								)
							);
		$arrayDeleteRequired	= array();
		$arraySubInput			= array(
												"Sub Input for data Sample",
												array
												(
													array
													(
															"nama"							// Field_name
															, "Nama"							// Text
															, $this->master->FIELD_VALUE_DEFAULT	// Value method
															, array(							// Input type
																	$this->master->INPUT_TYPE_TEXT
																	, array(
																			"MAX_LENGTH" 	=> 200
																			, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
																			)
																	)
															, null								// source
															, $this->master->VALIDATION_NOTNULL // validation
													),
													array
													(
															"keterangan"							// Field_name
															, "Nama"							// Text
															, $this->master->FIELD_VALUE_DEFAULT	// Value method
															, array(							// Input type
																	$this->master->INPUT_TYPE_TEXT_AREA
																	, array(
																			"ROWS" 	=> 5
																			, "COLS"		=> $this->master->ATTR_SIZE_MEDIUM
																			)
																	)
															, null								// source
															, $this->master->VALIDATION_NOTNULL // validation
													),
													array
													( "jenis_kelamin"							// Field_name
															, "Jenis Kelamin"							// Text
															, $this->master->FIELD_VALUE_DEFAULT	// Value method
															, array(							// Input type
																	$this->master->INPUT_TYPE_RADIO
																	)
															, array(array("l", "Laki-laki")
																		, array("p", "Perempuan")
																	)
																									// source
															, $this->master->VALIDATION_NOTNULL // validation
													),
													array
													( 
														"itu"								// Field_name
														, "Itu select"							// Text
														, $this->master->FIELD_VALUE_DEFAULT	// Value method
														, array
															(							// Input type
																$this->master->INPUT_TYPE_SELECT
															)
														, array(array("Hitam")
																, array("PUTIH")
																, array("PUCAT")
																, array("KASAR")
															)								// source
														, $this->master->VALIDATION_NOTNULL // validation
													),
													array
													( 
														"agama"								// Field_name
														, "Agama"							// Text
														, $this->master->FIELD_VALUE_DEFAULT	// Value method
														, array
															(							// Input type
																$this->master->INPUT_TYPE_SIMPLE_TABLE
															)
														, array
															(
																"data_opsi"						// field
																, "id_opsi"						// id 
																, "sample_table_opsi_data"		// table source						
															)								// source
														, array
															(
																$this->master->VALIDATION_MATCH_TABLE
																, array("sample_table_opsi_data", "id_opsi")
															) // validation
													),
													array
													( 
														"kebangsaan"								// Field_name
														, "Kebangsaan"							// Text
														, $this->master->FIELD_VALUE_DEFAULT	// Value method
														, array
															(							// Input type
																$this->master->INPUT_TYPE_MEDIUM_TABLE
															)
														, array
															(
																array(array("nama_data","nd", true, "Nama Data")
																		, array("select_one", "so", false, "Select One", 
																		array(array("m", "Male"),array("f", "Female")))
																	)										// field
																, "id_opsi"									// id 
																, array("sample_table_select_data", "stsd")	// table_name						
																, array
																	(
																	array(
																		array("sample_table_opsi_data","stod")		// table join
																		, array("sample_table_select_data","stsd")	// table source
																		, "id_opsi"									// field join
																		, "id_opsi"									// field source
																		, array
																			(
																				array("data_opsi","",true, "Data Opsi")
																			)	// field join
																		)
																	)
															)
														, array
															(
																$this->master->VALIDATION_MATCH_TABLE
																, array("sample_table_select_data", "id_opsi")
															) // validation
													),
													array
													( 
														"keituan"								// Field_name
														, "Keituan"								// Text
														, $this->master->FIELD_VALUE_DEFAULT	// Value method
														, array
															(							// Input type
																$this->master->INPUT_TYPE_ADVANCE_TABLE
															)
														, array
															(
																array
																	(
																		array("nama_data", "nd", true, "Nama Data")
																		, array
																			(
																				"select_one",
																				"so", 
																				true, 
																				"Select One", 
																				array
																				(
																					array("m", "Male"),
																					array("f", "Female")
																				)
																			)
																	)							// field
																, "id_opsi"						// id 
																, array("sample_table_select_data", "stsd")	// table_name						
																, array
																	(
																		array(
																			array("sample_table_opsi_data","stod")	// table join
																			, array(
																				"sample_table_select_data","stsd"
																					)								// table source
																			, "id_opsi"								// field join
																			, "id_opsi"								// field source
																			, array
																				(
																					array
																						(
																						"data_opsi","",true, "Data Opsi"
																						)
																				)							// field join
																			)
																	)
																, array
																	(										// filter field
																		array(
																			"Select Data"					
																			, array
																				(
																					"sample_table_select_data", "stsd"
																				)								// table destination
																			, "nama_data"						// field destination
																			, $this->master->INPUT_TYPE_TEXT	// type input search
																			, array()							// source
																			)
																		, array(
																			"Search Radio"					
																			, array
																				(
																					"sample_table_select_data", "stsd"
																				)								// table destination
																			, "select_one"						// field destination
																			, $this->master->INPUT_TYPE_RADIO	// type input search
																			, array
																				(
																					array("m", "Male")
																					,array("f", "Female")
																				)								// source
																			)
																		, array(
																			"Search Select"					
																			, array
																				(
																					"sample_table_select_data", "stsd"
																				)								// table destination
																			, "select_one"						// field destination
																			, $this->master->INPUT_TYPE_SELECT	// type input search
																			, array
																				(
																					array("m", "Male")
																					,array("f", "Female")
																				)								// source
																			)
																		, array
																			(
																			"Search Select"
																			, array("sample_table_opsi_data", "stod")
																			, "id_opsi"
																			, $this->master->INPUT_TYPE_SIMPLE_TABLE
																			, array("data_opsi"						// field
																					, "id_opsi"						// id 
																					, "sample_table_opsi_data"		// table source						
																					)
																			)
																	)							// filter field
															)
														, array
															(
																$this->master->VALIDATION_MATCH_TABLE
																, array("sample_table_select_data", "id_opsi")
															) // validation
													),
												),
												"sample_table_sub_input",				// table name
												"id_sub_input",							// field id
												"id_coba",								// field foreign
										);
			
		$this->engineReturn = $this->master->generateSystem(
		$arraySetting
		, $arrayField
		, $arraySubInput
		, $arrayDeleteRequired);
		return $this->engineReturn;
	}

	public function download_materi_sub_siswa($pageTitle, $pageUrl)
	{
		$arraySetting 	= array(
		$pageTitle									// page title
		, $pageUrl									// page url
		, false										// Insert new record
		, false										// Edit Record
		, false										// Delete Record
		, false										// Edit Record if not null
		, $this->master->PAGINATION_ADV_NEXT_PREV_NUMBER	// Pagination Type
		,  "tbl_upload_file"					// Table Name
		, false										// Input Mode cross record
		, $this->loginIdUser						// id_user
		, ""										// akses
		, "application/views/upload/"				// upload folder
		, $this->config->item('base_url')			// base url
		, $this->data["engineTemplate"]				// adminPath
		, $pageUrl									// modulename
		);
		$arrayField 	= array(
							array(
									"id_upload_file"					// Field_name
									, "ID"						// Text
									, $this->master->FIELD_VALUE_AUTO	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_HIDDEN
											)
									, true						// Primary key
									, false						// view
									, false						// edit
									, null						// source
									, $this->master->VALIDATION_NONE	// validation
									, false						// filter
									, null						// filter source
								)
							, array(
									"id_dosen"					// Field_name
									, "Kode Dosen"					// Text
									, $this->master->FIELD_VALUE_USER	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_HIDDEN
											)
									, false						// Primary key
									, false						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, true	// filter source
									, null  // note
									)
							, array(
									"nama_file"						// Field_name
									, "Judul File"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, true						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										, null
										)						// filter source
								)
							, array(
									"keterangan"						// Field_name
									, "Keterangan"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT_AREA
											, array(
													"ROWS" 			=> 5
													, "COLS"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, array(
										)						// filter source
								)
							, array(
									"file_url"						// Field_name
									, "Alamat File"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, array(
										)						// filter source
									, array(
										"Upload File anda ke penyedia layanan Upload."
										, "Paste alamat downloadnya ke input ini."
										)
								)
							, array(
									"publish"				// Field_name
									, "Publish"			// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_RADIO
											)
									, false						// Primary key
									, false				// view
									, false						// edit
									, array(array("y", "Yes")
											, array("n", "No")
											)
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, array($this->master->INPUT_TYPE_RADIO
											, null)						// filter source 
									, null
									, array(
											$this->master->OPERATOR_EQUAL,
											"y",
											)
									
								)
							);
		$arrayDeleteRequired	= array();
		$arraySubInput			= array();
			
		$this->engineReturn = $this->master->generateSystem(
		$arraySetting
		, $arrayField
		, $arraySubInput
		, $arrayDeleteRequired);
		return $this->engineReturn;
	}
		
	public function jadwal_mapel_sub_siswa($pageTitle, $pageUrl)
	{
		$arraySetting 	= array(
		$pageTitle									// page title
		, $pageUrl									// page url
		, false										// Insert new record
		, false										// Edit Record
		, false										// Delete Record
		, true										// Edit Record if not null
		, $this->master->PAGINATION_ADV_NEXT_PREV_NUMBER	// Pagination Type
		,  "tbl_jadwal"					// Table Name
		, false										// Input Mode cross record
		, ""										// id_user
		, ""										// akses
		, "application/views/upload/"				// upload folder
		, $this->config->item('base_url')			// base url
		, $this->data["engineTemplate"]				// adminPath
		, $pageUrl									// modulename
		);
		$arrayField 	= array(
							array(
									"id_jadwal"					// Field_name
									, "ID"						// Text
									, $this->master->FIELD_VALUE_AUTO	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_HIDDEN
											)
									, true						// Primary key
									, false						// view
									, false						// edit
									, null						// source
									, $this->master->VALIDATION_NONE	// validation
									, false						// filter
									, null						// filter source
								)
							, array(
									"kode_kelas"						// Field_name
									, "Kelas"					// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_SIMPLE_TABLE
											, array()
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, array("nama_kelas"						// field
											, "kode_kelas"						// id 
											, "tbl_kelas"		// table source						
											, array(
													)
											)
									, array($this->master->VALIDATION_MATCH_TABLE
											, array("tbl_kelas", "kode_kelas")
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_SIMPLE_TABLE)		// filter source 
								)
							, array(
									"kode_mata_pelajaran"						// Field_name
									, "Mata Pelajaran"					// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_SIMPLE_TABLE
											, array()
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, array("mata_pelajaran"						// field
											, "kode_mata_pelajaran"						// id 
											, "tbl_mata_pelajaran"		// table source						
											, array(
													)
											)
									, array($this->master->VALIDATION_MATCH_TABLE
											, array("tbl_mata_pelajaran", "kode_mata_pelajaran")
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_SIMPLE_TABLE)		// filter source 
								)
							, array(
									"hari"				// Field_name
									, "Hari"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_SELECT
											, array("SIZE" => $this->master->ATTR_SIZE_MEDIUM)
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, array(array("senin", "Senin")
											, array("selasa", "Selasa")
											, array("rabu", "Rabu")
											, array("kamis", "Kamis")
											, array("jumat", "Jum'at")
											, array("sabtu", "Sabtu")
											, array("minggu", "Minggu")
											)
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_SELECT)		// filter source 
								)
							, array(
									"jam_mulai"						// Field_name
									, "Jam Mulai"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 5
													, "SIZE"		=> $this->master->ATTR_SIZE_SHORT
													)
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_TIME
											)					// validation
									, false						// filter
									, array(
										)						// filter source
									, array("Format HH:MM"
											, "Ex. 08:15, 21:30.")
								)
							, array(
									"jam_selesai"						// Field_name
									, "Jam Selesai"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 5
													, "SIZE"		=> $this->master->ATTR_SIZE_SHORT
													)
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_TIME
											)					// validation
									, false						// filter
									, array(
										)						// filter source
									, array("Format HH:MM"
											, "Ex. 08:15, 21:30.")
								)
							);
		$arrayDeleteRequired	= array();
		$arraySubInput			= array();
			
		$this->engineReturn = $this->master->generateSystem(
		$arraySetting
		, $arrayField
		, $arraySubInput
		, $arrayDeleteRequired);
		return $this->engineReturn;
	}
	
	public function edit_profil_sub_siswa($pageTitle, $pageUrl)
	{
		$arraySetting 	= array(
		$pageTitle									// page title
		, $pageUrl									// page url
		, false										// Insert new record
		, true										// Edit Record
		, false										// Delete Record
		, true										// Edit Record if not null
		, $this->master->PAGINATION_NONE	// Pagination Type
		,  "tbl_siswa"					// Table Name
		, false										// Input Mode cross record
		, ""										// id_user
		, ""										// akses
		, "application/views/upload/"				// upload folder
		, $this->config->item('base_url')			// base url
		, $this->data["engineTemplate"]				// adminPath
		, $pageUrl									// modulename
		);
		$arrayField 	= array(
							array(
									"nim"					// Field_name
									, "NIM"						// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 50
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, true						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, null	// filter source
									, null  // note
									, array(
											$this->master->OPERATOR_EQUAL,
											$this->loginIdUser,
									)						// filter source
								)
							, array(
									"nama"						// Field_name
									, "Nama"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										, null
										)						// filter source
								)
							, array(
									"jenis_kelamin"				// Field_name
									, "Jenis Kelamin"			// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_RADIO
											)
									, false						// Primary key
									, true				// view
									, false						// edit
									, array(array("1", "Laki-laki")
											, array("0", "Perempuan")
											)
									, array($this->master->VALIDATION_NOTNULL
											)					// validation
									, false						// filter
									, array($this->master->INPUT_TYPE_RADIO
											, null)						// filter source 
								)
							, array(
									"tempat_lahir"						// Field_name
									, "Tempat Lahir"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NONE
											)					// validation
									, false						// filter
									, array(
										)						// filter source
								)
							, array(
									"tanggal_lahir"						// Field_name
									, "Tanggal Lahir"					// Nama
									, $this->master->FIELD_VALUE_DATE	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 10
													, "SIZE"		=> $this->master->ATTR_SIZE_SHORT
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_DATE
											)					// validation
									, false						// filter
									, array(
										)						// filter source
								)
							, array(
									"agama"				// Field_name
									, "Agama"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_SELECT
											, array("SIZE" => $this->master->ATTR_SIZE_MEDIUM)
									)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array(array("Islam")
											, array("Kristen")
											, array("Hindu")
											, array("Budha")
											, array("Katolik")
											, array("Lainnya")
									)
									, array($this->master->VALIDATION_NOTNULL
									)					// validation
									, false						// filter
									, array($this->master->INPUT_TYPE_SELECT)		// filter source
							)
							, array(
									"alamat"		// Field_name
									, "Alamat"		// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 400
													, "SIZE"		=> $this->master->ATTR_SIZE_LONG
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NONE
											)					// validation
									, false						// filter
									, array(
										)						// filter source
								)
							, array(
									"no_hp"						// Field_name
									, "No Handphone"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 100
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NONE
											)					// validation
									, false						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										, null
										)						// filter source
								)
							, array(
									"email"		// Field_name
									, "Email"		// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, true						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_EMAIL
											)					// validation
									, false						// filter
									, array(
										)						// filter source
								)
							, array(
									"website"		// Field_name
									, "Website"		// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, true						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_URL
											)					// validation
									, false						// filter
									, array(
										)						// filter source
									, array("format website : http://alamat.com")
								)
							, array(
									"facebook"						// Field_name
									, "Alamat Facebook"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 100
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NONE
											)					// validation
									, false						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										, null
										)						// filter source
									, array("Format : http://www.facebook.com/id_facebook"
											,"Contoh =>"
											, "http://www.facebook.com/9797927368"
											, "http://www.facebook.com/inolabs"
											)
								)
							, array( 
									"twitter"						// Field_name
									, "Alamat Twitter"					// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 100
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NONE
											)					// validation
									, false						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										, null
										)						// filter source
									, array("Format : http://www.twitter.com/twitter"
											,"Contoh =>"
											, "http://www.twitter.com/9797927368"
											, "http://www.twitter.com/inolabs"
											)
								)
							, array(
									"pass"		// Field_name
									, "Password"		// Nama
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_PASSWORD
											, array(
													"MAX_LENGTH" 	=> 200
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, null						// source
									, array($this->master->VALIDATION_NONE
											)					// validation
									, false						// filter
									, array ()					// filter source
									, array(
											"Kosongkan jika tidak ingin mengubah."
										)						
									)
							, array(
									"photo"				// Field_name
									, "Poto"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_IMAGE
											, array("SIZE" => $this->master->ATTR_SIZE_MEDIUM)
											)
									, false						// Primary key
									, false						// view
									, true						// edit
									, array("siswa")
									, array($this->master->VALIDATION_FILE_TYPE
											, array("jpg", "jpeg", "png", "bmp")
											, array(
												array(
														"initial" 	=>	"small"
														, "width" 	=>	200
														, "height"	=>  0
														, "type"	=> "resize"
													),
												array(
														"initial" 	=>	"admin"
														, "width" 	=>	100
														, "height"	=>  0
														, "type"	=> "resize"
														, "thumb_admin"	=> true
													),
												)				// resize
												, true
											)					// validation
									, false						// filter
									, null						// filter source 
								)
							);
		$arrayDeleteRequired	= array();
		$arraySubInput			= array();
			
		$this->engineReturn = $this->master->generateSystem(
		$arraySetting
		, $arrayField
		, $arraySubInput
		, $arrayDeleteRequired);
		return $this->engineReturn;
	}
	
	public function cek_nilai_sub_siswa($pageTitle, $pageUrl)
	{
		$arraySetting 	= array(
		$pageTitle									// page title
		, $pageUrl									// page url
		, false										// Insert new record
		, false										// Edit Record
		, false										// Delete Record
		, false										// Edit Record if not null
		, $this->master->PAGINATION_ADV_NEXT_PREV_NUMBER	// Pagination Type
		,  "tbl_krs"					// Table Name
		, false										// Input Mode cross record
		, ""										// id_user
		, ""										// akses
		, "application/views/upload/"				// upload folder
		, $this->config->item('base_url')			// base url
		, $this->data["engineTemplate"]				// adminPath
		, $pageUrl									// modulename
		);
		$arrayField 	= array(
							array(
									"id_krs"					// Field_name
									, "ID"						// Text
									, $this->master->FIELD_VALUE_AUTO	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_HIDDEN
											)
									, true						// Primary key
									, false						// view
									, false						// edit
									, null						// source
									, $this->master->VALIDATION_NONE	// validation
									, false						// filter
									, null						// filter source
								)
							, array(
									"id_mata_kuliah_jurusan"				// Field_name
									, "Mata Kuliah dan Jurusan"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_ADVANCE_TABLE
											, array()
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, array(
											array()							// field
											, "id_mata_kuliah_jurusan"						// id 
											, array("tbl_mata_kuliah_jurusan", "tmkj")	// table_name						
											, array
													(
													array(
														array("tbl_mata_kuliah","tmk")	// table join
														, array(
															"tbl_mata_kuliah_jurusan","tmkj"
																)								// table source
														, "kode_mata_kuliah"								// field join
														, "kode_mata_kuliah"								// field source
														, array
															(
																array
																	(
																	"nama_mata_kuliah","",true, "Nama Mata Kuliah"
																	)
															)							// field join
														),
													array(
														array("tbl_jurusan","tj")	// table join
														, array(
															"tbl_mata_kuliah_jurusan","tmkj"
																)								// table source
														, "kode_jurusan"								// field join
														, "kode_jurusan"								// field source
														, array
															(
																array
																	(
																	"nama_jurusan","",true, "Nama Jurusan"
																	)
															)							// field join
														),
													array(
														array("tbl_tahun_ajaran","ta")	// table join
														, array(
															"tbl_mata_kuliah_jurusan","tmkj"
																)								// table source
														, "id_tahun_ajaran"								// field join
														, "id_tahun_ajaran"								// field source
														, array
															(
																array
																	(
																	"tahun_ajaran","",true, "Tahun Ajaran"
																	)
															)							// field join
														),
													array(
														array("tbl_semester","ts")	// table join
														, array(
															"tbl_mata_kuliah_jurusan","tmkj"
																)								// table source
														, "id_semester"								// field join
														, "id_semester"								// field source
														, array
															(
																array
																	(
																	"semester","",true, "Semester"
																	)
															)							// field join
														),
													)
											, array
												(										// filter field
													array
													(
													"Mata Kuliah"
													, array("tbl_mata_kuliah", "tmk")
													, "kode_mata_kuliah"
													, $this->master->INPUT_TYPE_SIMPLE_TABLE
													, array("nama_mata_kuliah"						// field
															, "kode_mata_kuliah"						// id 
															, "tbl_mata_kuliah"		// table source						
															)
													), 
													array
													(
													"Tahun Ajaran"
													, array("tbl_tahun_ajaran", "ta")
													, "id_tahun_ajaran"
													, $this->master->INPUT_TYPE_SIMPLE_TABLE
													, array("tahun_ajaran"						// field
															, "id_tahun_ajaran"						// id 
															, "tbl_tahun_ajaran"		// table source						
															)
													), 
												)							// filter field

										)
									, array($this->master->VALIDATION_MATCH_TABLE
											, array("sample_table_select_data","id_opsi")
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_MEDIUM_TABLE)						// filter source 
								) 
							, array(
									"id_kelas_detail"				// Field_name
									, "Detail Kelas"				// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_ADVANCE_TABLE
											, array()
											)
									, false						// Primary key
									, false						// view
									, false						// edit
									, array(
											array()							// field
											, "id_kelas_detail"						// id 
											, array("tbl_kelas_detail", "tkd")	// table_name						
											, array
												(
													array(
														array("tbl_kelas","tk")	// table join
														, array(
															"tbl_kelas_detail","tkd"
																)								// table source
														, "kode_kelas"								// field join
														, "kode_kelas"								// field source
														, array
															(
																array
																	(
																	"nama_kelas","",true, "Nama Kelas"
																	)
															)							// field join
														),
													array(
														array("tbl_tahun_ajaran","ta")	// table join
														, array(
															"tbl_kelas_detail","tkd"
																)								// table source
														, "id_tahun_ajaran"								// field join
														, "id_tahun_ajaran"								// field source
														, array
																(
																	array
																	(
																	"tahun_ajaran","",true, "Tahun Ajaran"
																	)
																)							// field join
														),
													array(
														array("tbl_semester","ts")	// table join
														, array(
															"tbl_kelas_detail","tkd"
																)								// table source
														, "id_semester"								// field join
														, "id_semester"								// field source
														, array
															(
																array
																	(
																	"semester","",true, "Semester"
																	)
															)							// field join
														),
													array(
														array("tbl_jurusan","tj")	// table join
															, array(
															"tbl_kelas_detail","tkd"
																)								// table source
														, "kode_jurusan"								// field join
														, "kode_jurusan"								// field source
														, array
															(
																array
																	(
																	"nama_jurusan","",true, "Nama Jurusan"
																	)
															)							// field join
														),
													)
												, array
												(										// filter field
													array
													(
													"Tahun Ajaran"
													, array("tbl_tahun_ajaran", "ta")
													, "id_tahun_ajaran"
													, $this->master->INPUT_TYPE_SIMPLE_TABLE
													, array("tahun_ajaran"						// field
															, "id_tahun_ajaran"						// id 
															, "tbl_tahun_ajaran"		// table source						
															)
													), 
												)							// filter field
										)
										, array($this->master->VALIDATION_MATCH_TABLE
											, array("tbl_kelas_detail","id_kelas_detail")
											)					// validation
									, true						// filter
									, array($this->master->INPUT_TYPE_MEDIUM_TABLE)						// filter source 
								)
							, array(
									"nim"					// Field_name
									, "NIM"						// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_TEXT
											, array(
													"MAX_LENGTH" 	=> 50
													, "SIZE"		=> $this->master->ATTR_SIZE_MEDIUM
													)
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, null						// source
									, $this->master->VALIDATION_NOTNULL	// validation
									, false						// filter
									, array(
										$this->master->INPUT_TYPE_TEXT
										)						// filter source
									, null
									, array(
											$this->master->OPERATOR_EQUAL,
											$this->loginIdUser,
											)
								)
							, array(
									"kode_nilai"						// Field_name
									, "Nilai"					// Text
									, $this->master->FIELD_VALUE_DEFAULT	// Value method
									, array(					// Input type
											$this->master->INPUT_TYPE_SIMPLE_TABLE
											, array()
											)
									, false						// Primary key
									, true						// view
									, false						// edit
									, array("kode_nilai"						// field
											, "kode_nilai"						// id 
											, "tbl_nilai"		// table source						
											, array(
													)
											)
									, array($this->master->VALIDATION_MATCH_TABLE
											, array("tbl_nilai", "kode_nilai")
											)					// validation
									, false						// filter
									, array($this->master->INPUT_TYPE_SIMPLE_TABLE)		// filter source 
								)
							);
		$arrayDeleteRequired	= array();
		$arraySubInput			= array();
			
		$this->engineReturn = $this->master->generateSystem(
		$arraySetting
		, $arrayField
		, $arraySubInput
		, $arrayDeleteRequired);
		return $this->engineReturn;
	}
		
	public function notFound()
	{
		echo "hoy jangan ngaco";
	}
}





?>